﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartCity.BasicData.Api.Write.Application.Command.GridType;
using SmartCity.BasicData.Common;

namespace SmartCity.BasicData.Api.Write.Controllers
{
    /// <summary>
    /// 网格类型控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GridTypeController : ControllerBase
    {
        private readonly IMediator mediator;

        public GridTypeController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 添加网格类型接口
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ApiResult<int>> CreateGridType(CreateGridTypeCommand command) {
        return mediator.Send(command);
        }
    }
}
